home *** CD-ROM | disk | FTP | other *** search
- Path: news_1.cyrix.com!usenet
- From: Ken Toney <kent>
- Newsgroups: comp.lang.c++
- Subject: Use of templates in a large c++ project.
- Date: 12 Mar 1996 15:40:06 GMT
- Organization: Cyrix Corporation
- Message-ID: <4i45sm$97q@news_1.cyrix.com>
- NNTP-Posting-Host: dufess.eng.cyrix.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.4 sun4m)
- X-URL: news:comp.lang.c++/164562-164661
-
- I am investigating the feasiblity and use of templates in a large c++
- program that has several library archives, header files for the library
- archives, and source some source code.
-
- I would like to invoke some discussion on the following:
-
- Ken replies...
-
- I agree with...
- >"The last thing you want to do is include .cc files
- >in multiple translation units because the duplication
- >of code may lead to a larger than expected executable."
-
- But it is a way avoid explicitly instantiated templates.
-
- Actually you are expanding on the original problem that I
- uncovered, "it just happens to be your responsibility to
- instantiate the template". This little feature becomes a
- management/development nightmare for large c++
- projects (multiple library
- archives, millions lines of code, many programmers).
- First of all, making sure all the templates are
- explicitly instantiated "by hand" means that
- someone has to maintain it and *always* keep it current
- (if not, a group of programmers can not link).
- Second of all, link time could go up since the
- programmer may have to include the template library
- several times in the link command.
-
-
- A friend of mine how works at a company that uses
- templates on a large c++ project say they
- suffer from long link times and problems with
- undefined and/or multiply defined templates thus
- causing product release delays.
-
- This company when they auto-instantiate, causes
- multiply defined symbols; When this company explicitly
- instantiations, they have to include the template
- library archive several times in the link command.
-
- We both came from a company that a did not
- use templates and had none of the above problems.
-
- I do not think templates are feasible for a large
- c++ project since every template type has to
- be explicitly instantiated in file they are
- defined and comments from friends about the
- link problems.
-
-